<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDatabasesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('databases', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->default('')->comment('名称');
            $table->string('host')->default('')->comment('主机');
            $table->string('port')->default('')->comment('端口');
            $table->string('database')->default('')->comment('数据库');
            $table->string('username')->default('')->comment('用户名');
            $table->string('password')->nullable()->comment('密码');
            $table->integer('status')->default('0')->nullable()->comment('状态');
            $table->integer('creator_id')->default('0')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('databases');
    }
}
